//2009/08/09 22:43:38
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

class SkipRope
{
public:
    vector <int> partners(vector <int> cand, int height)
    {
        vector<int> ret;
        sort(cand.begin(), cand.end());

        int best = 0;
        for (int i=0; i<cand.size(); i++)
        {
            if (abs(cand[i] - height) <= abs(cand[best] - height)) best = i;
        }
        ret.push_back(cand[best]);
        cand.erase(cand.begin() + best);
        best = 0;
        for (int i=0; i<cand.size(); i++)
        {
			if (abs(cand[i] - height) <= abs(cand[best] - height)) best = i;
        }
		ret.push_back(cand[best]);
		sort(ret.begin(), ret.end());
        return ret;
    }
};
